package com.ugoodtech.mdcc.core.domain;

/* Copyright (C) Ugoodtech, Inc - All Rights Reserved.
 * Unauthorized copying of this file, via any medium is strictly prohibited.
 * Proprietary and confidential.
 * Written by Stone Shaw.
 */

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.util.List;

@ApiModel("问题分组")
@Entity
@Table(name = "question_groups")
public class QuestionGroup extends BaseEntity {
    @ApiModelProperty("标题")
    private String title;
    @ApiModelProperty("序号")
    private Integer idx;
    private QuestionSection questionSection;
    private List<Question> questions;
    @ApiModelProperty("拥有者")
    private Integer owner;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getOwner() {
        return owner;
    }

    public void setOwner(Integer owner) {
        this.owner = owner;
    }

    @ManyToOne
    @JoinColumn(name="section_id")
    @JsonIgnore
    public QuestionSection getQuestionSection() {
        return questionSection;
    }

    public void setQuestionSection(QuestionSection questionSection) {
        this.questionSection = questionSection;
    }

    public Integer getIdx() {
        return idx;
    }

    public void setIdx(Integer idx) {
        this.idx = idx;
    }

    @Transient
    public List<Question> getQuestions() {
        return questions;
    }

    public void setQuestions(List<Question> questions) {
        this.questions = questions;
    }
}
